.modal {
  .fixedStyle();
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  &.show {
    transform: translateX(0);
  }
  &.hide {
    transform: translateX(100%);
  }
  &.placement-top.hide {
    transform: translateY(-100%);
  }
  &.placement-bottom.hide {
    transform: translateY(100%);
  }
  &.placement-left.hide {
    transform: translateX(-100%);
  }
  &.placement-right.hide {
    transform: translateX(100%);
  }
}

.drawer {
  .drawer-inner {
    box-sizing: border-box;
    transition: transform 0.3s ease-in-out;
  }
  &.show {
    .drawer-mask {
      display: block;
    }
    .drawer-inner {
      transform: translateY(0);
    }
  }
  &,
  &.hide {
    .drawer-inner {
      transform: translateY(100%);
    }
  }
  &.placement-top {
    &.hide .drawer-inner {
      transform: translateY(-100%);
    }
    .drawer-inner {
      top: 0;
      width: 100%;
      height: var(--height);
    }
  }
  &.placement-bottom {
    &.hide .drawer-inner {
      transform: translateY(100%);
    }
    .drawer-inner {
      bottom: 0;
      width: 100%;
      height: var(--height);
      padding-bottom: constant(safe-area-inset-bottom);
      padding-bottom: env(safe-area-inset-bottom);
    }
  }
  &.placement-left {
    &.hide .drawer-inner {
      transform: translateX(-100%);
    }
    .drawer-inner {
      left: 0;
      width: var(--width);
      height: 100%;
    }
  }
  &.placement-right {
    &.hide .drawer-inner {
      transform: translateX(100%);
    }
    .drawer-inner {
      right: 0;
      width: var(--width);
      height: 100%;
    }
  }
  .drawer-mask {
    .fixedStyle();
    display: none;
    background-color: #000000;
    opacity: 0.4;
  }
  .drawer-inner {
    position: fixed;
    z-index: 99;
    display: flex;
    flex-flow: column nowrap;
    overflow: hidden;
    background-color: #ffffff;
    .drawer-body {
      flex: 1;
      overflow: auto;
    }
  }
}

.fixedStyle() {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99;
}
.placementAnimation() {
  &.hide {
    transform: translateX(100%);
  }
  &.placement-top {
    &.hide {
      transform: translateY(-100%);
    }
  }
  &.placement-bottom {
    &.hide {
      transform: translateY(100%);
    }
  }
  &.placement-left {
    &.hide {
      transform: translateX(-100%);
    }
  }
  &.placement-right {
    &.hide {
      transform: translateX(100%);
    }
  }
}
